<template>
    <div class="pipline-config">
        <div class="pipeline-config-header">任务流编辑器</div>
        <el-form>
            <div class="pipeline-name">
                <div>名称：</div>
                <el-form-item prop="name">
                    <el-input v-model="pipelineForm.name" />
                </el-form-item>
            </div>
            <div class="pipeline-label">
                <div>自定义标签</div>
                <el-form-item>
                    <el-input v-model="pipelineForm.tag" />
                </el-form-item>
            </div>

            <div class="cron-type">
                <div>调度类型</div>
                <el-form-item>
                    <el-radio-group v-model="pipelineForm.cronType">
                        <el-radio-button label="执行一次" name="once" />
                        <el-radio-button label="定时执行" name="everyday" />
                    </el-radio-group>
                </el-form-item>
            </div>

            <div class="cron-time">
                <div>执行时间</div>
                <el-form-item>
                    <el-input v-model="pipelineForm.cronTime" />
                </el-form-item>
            </div>

            <div class="created">
                <div>创建时间</div>
                <el-form-item>
                    <el-input v-model="pipelineForm.created" />
                </el-form-item>
            </div>
        </el-form>
        <div class="pipeline-footer">
            <el-button type="primary" @click="savePipeline">保存</el-button>
            <el-button @click="cancel">取消</el-button>
        </div>
    </div>
</template>

<script setup>
import { reactive } from 'vue';
const props = defineProps({
    pipeline: {
        type: Object,
        // required:true
    }
})

const pipelineForm = reactive({
    name: 'xx的第一个任务流',
    tag: '',
    cronType: 'once',
    cronTime: '',
    created: props.pipeline.created,
    nodes:[],
    edges:[],
    status: 'running',
    user: 'admin',
    // id:props.pipeline.id,

})

// console.log('props.pipeline',props.pipeline);
</script>

<style lang="scss" scoped>
.pipeline-config-header{
    height: var(--supereditor-header-height);
    border-bottom: 1px solid #eee;
    text-align: center;
    line-height: var(--supereditor-header-height);
}
</style>